/**
 * Copyright 2012 Fonfon.Fenceer
 * All rights reserved.
 * 
 * @project 
 * @author Fonfon.Fenceer
 * @version 1.0
 * @data 2012-3-15
 */
package com.guidecaptain.java.service.impl;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.guidecaptain.java.mapper.GuidefmMapper;
import com.guidecaptain.java.model.pojo.Guidefm;
import com.guidecaptain.java.service.GuidefmService;

/**
 * 
 * @author fenceer
 */
@Service("guidefmService")
public class GuidefmServiceImpl implements GuidefmService{
	private Logger LOG = Logger.getLogger(GuidefmServiceImpl.class);
	
	@Autowired
	private GuidefmMapper guidefmMapper;
	
	/** 
	 * @param 
	 * @return 
	 */
	@Override
	public boolean insertGudiefm(List<Guidefm> guidefms) {
		try {
			for(Guidefm guidefm:guidefms){
				guidefmMapper.insertGuidefm(guidefm);
			}
		} catch (Exception e) {
			LOG.error(e);

			return false;
		}
		
		return true;
	}

	/** 
	 * @param 
	 * @return 
	 */
	@Override
	public int deleteGudiefm(int gfmId) {
		
		return guidefmMapper.deleteGuidefm(gfmId);
	}

	/** 
	 * @param 
	 * @return 
	 */
	@Override
	public int updateGudiefm(Guidefm guidefm) {
		
		return guidefmMapper.updateGuidefm(guidefm);
	}

	/** 
	 * @param 
	 * @return 
	 */
	@Override
	public List<Guidefm> queryGuidefmList(int guideId) {
		Guidefm guidefm=new Guidefm();
		guidefm.setGuideId(guideId);
		return guidefmMapper.queryGuidefm(guidefm);
	}

}
